package com.a;

public class Arra {
    public static void main(String[] args) {

        int a[]=new int[]{12,34,56};
        //int a[]={12,34};
        double[] score=new double[]{23.32,32.4,43.55,34.6};

        //地址信息
        System.out.println(a);
        System.out.println(score);
        System.out.println("=======");
        //数组访问

        //数组长度
        System.out.println(a.length);
        System.out.println(score.length);
        System.out.println("=======");
        //数组索引
        System.out.println(a[0]);
        System.out.println(score[3]);
        System.out.println("=======");
        //遍历数组
        // 打印
        for(int i=0;i<a.length;i++)
        {
            System.out.println(a[i]);
        }

        //数组最大索引:数组中存在数据  a[0],a[1],a[2]
        System.out.println(a.length-1);
        System.out.println("=======");
        //数组动态初始化
        int b[]=new int[8];
        System.out.println("数组b长度"+b.length);
        for(int i=0;i<b.length;i++)
        {
            System.out.println(b[i]);
        }

        System.out.println("=======");
        char[] c=new char[3];
        System.out.println((int)c[0]);
        System.out.println(c[0]);

        System.out.println("=======");
        double[] d=new double[3];
        System.out.println(d[0]);
        System.out.println(d[2]);

        System.out.println("=======");
        String[] e=new String[3];
        System.out.println(e[0]);
        System.out.println(e[2]);

        System.out.println("=======");
        boolean[]f=new boolean[3];
        System.out.println(f[0]);
        System.out.println(f[2]);


    }
}
